@import 'mixins/loader';
@import 'scss-imports/variables';

.mat-mdc-card-content {
  flex-wrap: wrap;
  height: 100%;
  margin: 0;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-top: 8px;

  .title {
    display: flex;
    flex-grow: 1;
  }
}

.card-container {
  display: flex;
  flex-direction: column;
  padding: 0 5px;
}

.card {
  margin: 0 0 5px;
}

.card-content {
  display: flex;

  .chart-wrapper-outer {
    flex-grow: 1;
  }

  .legend {
    display: flex;
    flex-direction: column;
    width: 420px;

    @media (max-width: $breakpoint-sm) {
      width: 100%;
    }

    .legend-timestamp {
      align-items: center;
      display: flex;
      height: 32px;

      > h4 {
        display: flex;
        gap: 8px;
      }
    }
  }
}

.legend-group-wrapper {
  flex-grow: 1;
  overflow-x: hidden;
  overflow-y: auto;
}

table.legend-table {
  border-collapse: collapse;
  display: table;
  margin-right: 36px;
  width: 420px;

  @media (max-width: $breakpoint-sm) {
    width: 100%;
  }
}

tr.header th {
  border-bottom: solid 1px var(--lines);
  text-transform: capitalize;
}

tr.legend-group:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.1);
}

tr.header th,
td.legend-label {
  text-align: left;
}

tr.legend-group {
  display: table-row;
}

td.legend-label:nth-child(1) {
  padding-right: 0;
  width: 40%;
}

td.legend-label {
  display: table-cell;
  font-weight: 500;
  padding: 4px 12px 4px 4px;
}

.legend-label div {
  display: inline-block;
}

.legend .swatch {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  height: 12px;
  margin-right: 8px;
  width: 12px;
}

span.tooltip-value {
  color: var(--fg2);
  font-weight: 700;
}

.legend .tooltip-wrapper {
  height: 20px;
  padding-left: 8px;
}

.legend-item {
  font-weight: 400;
  padding: 4px 0;
  text-align: right;
  text-transform: capitalize;
}

.disk-grid-header {
  margin-left: 16px;
  text-align: left;
}

.disk-grid-header,
.disk-grid-controls {
  font-weight: 500;
  width: 100%;
}

.disk-grid-controls {
  text-align: right;
}

.disk-grid-controls button {
  margin-top: -7px;
}

.disk-grid-control {
  background-color: rgba(255, 255, 255, 0.1);
  border: solid 1px rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  font-size: 90%;
  margin: 0 4px;
  padding: 2px 5px 1px;
}

.disk-tile {
  background-color: var(--bg1);
}

.disk-name {
  font-size: 16px;
  font-weight: bold;
  margin: 0 4px 4px;
  width: 100%;
}

.high-density .disk-name {
  bottom: -5px;
  font-size: 60%;
  margin: 0;
  position: absolute;
}

.disk-icon {
  font-size: 18px;
  margin: 4px 0 2px;
}

.high-density .disk-icon {
  font-size: 160%;
  position: absolute;
  width: 100%;
}

.disk-icon,
.disk-name {
  color: #fff;
  color: var(--fg2);
  text-align: center;
}

.disk-tile,
.disk-icon,
.disk-name {
  cursor: pointer;
}

.disk-details {
  width: 100%;
}

.disk-detail-header {
  text-align: left;
}

span.disk-detail-title,
.disk-detail p.label {
  color: #666;
  color: var(--fg1);
  font-size: 75%;
  font-weight: normal;
  margin-bottom: -4px;
  opacity: 0.5;
}

p.value {
  font-size: 100%;
  font-weight: 400;
}

span.disk-detail-title {
  text-align: left;
}

span.disk-detail-subtitle {
  font-size: 0.85em;
  opacity: 0.65;
  text-align: left;
}

.pool-status {
  cursor: default;
  position: absolute;
  right: 16px;
  text-align: right;
}

.pool-status .ix-icon.ix-icon {
  bottom: -6px;
  margin: -4px 0 0 4px;
  position: relative;
}

.disk-detail-section {
  display: table;
  margin: 8px 8px 4px 16px;
  text-align: left;
  width: 100%;
}

.disk-detail-item {
  display: table-row;
}

.disk-detail-item > div {
  display: table-cell;
}

.disk-detail-temps-bar {
  border-bottom: solid 3px;
  border-image: linear-gradient(to right, lightseagreen, yellow 45%, red 55%);
  padding-bottom: 5px;
}

.disk-detail-temps-bar .mat-mdc-progress-bar-buffer {
  opacity: 0 !important;
}

.disk-detail-temp {
  max-height: 24px;
}

.disk-detail-temp-label {
  max-height: 65px;
}

.disk-detail-temp,
.disk-detail-temp-label {
  margin: 0 auto;
  max-width: calc(100% - 32px);
}

.disk-detail-temp-label {
  text-align: left;
}

.disk-detail-temp-label div.label {
  font-size: 75%;
}

.disk-detail-temp-label span.value {
  font-size: 2.75em;
  line-height: 1em;
}

.disk-detail-temp-label.hot span.value {
  color: #c00;
}

.disk-detail-temp-label.hot .mat-mdc-progress-bar-element {
  border: solid 7px #c00;
}

.disk-detail-temp-label span.temp-units {
  font-weight: 500;
}

.temps-bar-label {
  font-size: 75%;
}

.temps-bar-label.freeze {
  text-align: left;
}

.temps-bar-label.boil {
  text-align: right;
}

/* Disk Sets */
.diskset-wrapper-mask {
  overflow: hidden;
  width: 100%;
}

.diskset-wrapper {
  border-left: solid 1px rgba(0, 0, 0, 0.1);
  border-right: solid 1px rgba(0, 0, 0, 0.1);
}

.diskset {
  float: left;
  width: 100%;
}

.disk-array-ui {
  height: 100%;
}

.card-bg-wrapper {
  min-height: 100%;
}

div.line-chart-tools-wrapper {
  text-align: right;

  @media (max-width: $breakpoint-tablet) {
    max-width: 100% !important;
  }
}

div.line-chart-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;

  .mat-icon-button {
    align-items: center;
    display: inline-flex;
    font-size: 18px;
    justify-content: center;
    width: 40px;

    &:not(:first-child) {
      margin-left: 8px;
    }
  }
}

div.line-chart-tools ul {
  list-style-type: none;
}

/* Mobile */
.disk-array-ui.column {
  width: 100%;
}

.chart-wrapper {
  height: 200px;
}

.card-bg {
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: contain;
  height: 100%;
  width: 100%;
}

.report .card-bg-wrapper h3 {
  margin: 16px;
  text-align: left;
}

.logo-bg .os-logo {
  margin-top: 16%;
  width: 50%;
}

.xs .card-bg-wrapper {
  width: 100%;
}

.xs .card-bg {
  background-size: contain;
}

.data-container > div {
  margin: 8px 16px;
  text-align: left;
}

.data-container h3 {
  font-weight: 400;
}

.date {
  font-weight: normal;
}

.data-inline {
  display: inline-block;
  margin-right: 16px;
  width: calc(50% - 32px);
}

.build-date {
  font-size: 85%;
  font-style: italic;
  opacity: 0.5;
}

/* SUMMARY (LEFT SIDE) */
.pool-summary {
  display: table;
  height: 55%;
  padding: 8px;
  width: 100%;
}

.pool-data {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

.pool-data div.inner span.value {
  font-size: 300%;
}

.title-wrapper {
  background-color: rgba(0, 0, 0, 0.1);
  height: 45%;
  padding: 16px;
  text-align: left;
}

.title-wrapper .title {
  font-size: 150%;
}

.title-wrapper .subtitle {
  font-size: 80%;
}

.reports-btn {
  bottom: 16px;
  font-weight: 500;
  position: absolute;
  right: 16px;
  text-transform: capitalize;
}

/* DETAILS */
.label.bold strong {
  font-size: 75%;
  font-weight: normal;
  opacity: 0.5;
}

p.value {
  font-size: 100%;
  font-weight: 400;
}

.xs-footer {
  display: none;
}

/* NARROW SCREENS */
.xs.widget.double-height {
  width: 100%;
}

.xs .card-bg-wrapper {
  min-height: 40%;
}

.xs .pool-summary {
  height: 100%;
}

.xs .title-wrapper {
  height: 72px;
  position: absolute;
  top: 0;
  width: 100%;
}

.xs p.pool-status {
  top: 88px;
}

.xs .platform-logo img {
  bottom: 32px;
  position: absolute;
  width: 100px;
}

.xs .subtitle {
  bottom: 16px;
  font-size: 80%;
  position: absolute;
}

.xs .data-container {
  margin-top: 16px;
}

.xs .xs-footer {
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: block;
  max-height: 68px !important;
  width: 100%;
}

.xs .title-wrapper .reports-btn {
  display: none;
}

.legend-group {
  border: solid 1px rgba(0, 0, 0, 0);
  border-radius: 4px;
  margin: 0 0 0 4px;
}

.mat-mdc-card-title {
  font-size: initial;
  margin: 0;

  h3 {
    display: inline-block;
    font-size: 1.5rem;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.report {
  position: relative;

  /* Children get the padding so dividers fit the full width of card */
  .mat-mdc-card {
    padding-left: 0;
    padding-right: 0;

    &.loading {
      @include background-logo-loader(1);
      min-height: 325px;
    }
  }

  .mat-mdc-card-footer,
  .mat-toolbar-row,
  .legend-wrapper,
  .chart-wrapper {
    margin: 0;
    padding: 8px 26px;
  }
}

.total-line {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.report .legend-wrapper.timestamps {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;

  @media (max-width: $breakpoint-sm) {
    padding-left: 0;
    padding-right: 0;
  }

  .legend-timestamp {
    flex: 50%;

    &:first-child {
      @media (min-width: $breakpoint-sm) {
        padding-left: 55px;
      }
    }

    strong {
      margin-right: 8px;
    }

    span {
      display: inline-block;
      white-space: nowrap;
    }

    small {
      display: block;
      width: 100%;
    }
  }
}

.report .mat-mdc-card-footer {
  width: 100%;
}

.report .legend-group .report-analytics {
  border: var(--red);
  opacity: 0.75;
}

.report ix-empty {
  display: block;
  min-height: 277px;
  width: 100%;
}
